home *** CD-ROM | disk | FTP | other *** search
/ Maximum CD 2009 June / maximum-cd-2009-06.iso / DiscContents / digsby_setup.exe / res / MessageStyles / Smooth Separate Lines.AdiumMessageStyle / Contents / Resources / sample.html < prev    next >
Encoding:
Extensible Markup Language  |  2007-12-13  |  5.8 KB  |  148 lines

  1. <?xml version="1.0" encoding="utf-8"?>
  2. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml">
  4. <head>
  5.     <meta http-equiv="content-type" content="text/html; charset=utf-8" />
  6. <link rel="stylesheet" href="Variants/(Time) Alias.css" type="text/css" />
  7.     <script type="text/ecmascript" defer="defer">
  8.         var scrollToBottomIsNeeded = false;
  9.  
  10.         function appendMessage(html) {
  11.             //Remove any existing insertion point
  12.             insert = document.getElementById("insert");
  13.             if(insert) insert.parentNode.removeChild(insert);
  14.  
  15.             //Append the new message to the bottom of our chat block
  16.             chat = document.getElementById("Chat");
  17.             range = document.createRange();
  18.             range.selectNode(chat);
  19.             documentFragment = range.createContextualFragment(html);
  20.             chat.appendChild(documentFragment);
  21.             alignChat();
  22.         }
  23.         
  24.         function appendNextMessage(html){
  25.             //
  26.             insert = document.getElementById("insert");
  27.         
  28.             //make new node
  29.             range = document.createRange();
  30.             range.selectNode(insert.parentNode);
  31.             newNode = range.createContextualFragment(html);
  32.  
  33.             //swap
  34.             insert.parentNode.replaceChild(newNode,insert);
  35.             alignChat();
  36.         }
  37.         
  38.         function scrollToBottom() {
  39.             document.body.scrollTop = document.body.offsetHeight;
  40.         }
  41.  
  42.         function checkIfScrollToBottomIsNeeded() {
  43.             scrollToBottomIsNeeded = ( document.body.scrollTop >= ( document.body.offsetHeight - ( window.innerHeight * 1.2 ) ) );
  44.         }
  45.  
  46.         function scrollToBottomIfNeeded() {
  47.             if( scrollToBottomIsNeeded )
  48.                 document.body.scrollTop = document.body.offsetHeight;
  49.         }
  50.  
  51.         function setStylesheet( id, url ) {
  52.             code = "<style id=\"" + id + "\" type=\"text/css\" media=\"screen,print\">";
  53.             if( url.length ) code += "@import url( \"" + url + "\" );";
  54.             code += "</style>";
  55.             range = document.createRange();
  56.             head = document.getElementsByTagName( "head" ).item(0);
  57.             range.selectNode( head );
  58.             documentFragment = range.createContextualFragment( code );
  59.             head.removeChild( document.getElementById( id ) );
  60.             head.appendChild( documentFragment );
  61.         }
  62.         document.onclick = imageCheck;
  63.         function imageCheck() {
  64.             node = event.target;
  65.             if(node.tagName == 'IMG' && node.alt) {
  66.                 a = document.createElement('a');
  67.                 a.setAttribute('onclick', 'imageSwap(this)');
  68.                 a.setAttribute('src', node.src);
  69.                 text = document.createTextNode(node.alt);
  70.                 a.appendChild(text);
  71.                 node.parentNode.replaceChild(a, node);
  72.             }
  73.         }
  74.         function imageSwap(node) {
  75.             img = document.createElement('img');
  76.             img.setAttribute('src', node.src);
  77.             img.setAttribute('alt', node.firstChild.nodeValue);
  78.             node.parentNode.replaceChild(img, node);
  79.         }
  80.         function alignChat() {
  81.             var windowHeight = window.innerHeight;
  82.             if (windowHeight > 0) {
  83.                 var contentElement = document.getElementById('Chat');
  84.                 var contentHeight = contentElement.offsetHeight;
  85.                 if (windowHeight - contentHeight > 0) {
  86.                     contentElement.style.position = 'relative';
  87.                     contentElement.style.top = (windowHeight - contentHeight) + 'px';
  88.                 }
  89.                 else {
  90.                     contentElement.style.position = 'static';
  91.                 }
  92.             }
  93.         }
  94.         window.onresize = alignChat;
  95.  
  96.     </script>
  97. </head>
  98. <body onload="scrollToBottom();alignChat();">
  99. <div id="Chat">
  100. <div class="incoming context">
  101.     <div class="messagebody"><span class="prefix"><span class="timestampbefore">(20:41:49) </span><span class="sender">eevyl</span><span class="senderScreenName">eevyl@mac.com</span><span class="timestampafter"> (20:41:49)</span>: </span>%message%</div>
  102.     <div class="nextmessagebody"><div class="nextmessagetext">%message%</div></div>
  103. </div>
  104. <div class="outgoing context">
  105.     <div class="messagebody"><span class="prefix"><span class="timestampbefore">(20:41:49) </span><span class="sender">eevyl</span><span class="senderScreenName">eevyl@mac.com</span><span class="timestampafter"> (20:41:49)</span>: </span>huhuhuhu</div>
  106.     <div class="nextmessagebody"><div class="nextmessagetext">huhuhu</div></div>
  107.     <div class="nextmessagebody"><div class="nextmessagetext">whatever we may take</div></div>
  108. </div>
  109. <div class="outgoing">
  110.     <div class="messagebody">
  111.         <span class="prefix"><span class="timestampbefore">(20:41:49) </span><span class="sender">eevyl</span><span class="senderScreenName">eevyl@mac.com</span><span class="timestampafter"> (20:41:49)</span>: </span>
  112.         hu</div>
  113. </div>
  114. <div class="incoming">
  115.     <div class="messagebody">
  116.         <span class="prefix"><span class="timestampbefore">(20:41:49) </span><span class="sender">eevyl</span><span class="senderScreenName">eevyl@mac.com</span><span class="timestampafter"> (20:41:49)</span>: </span>
  117.         huhuhuhu
  118.     </div>
  119.     <div class="nextmessagebody"><div class="nextmessagetext">huhuhu</div></div>
  120.     <div class="nextmessagebody"><div class="nextmessagetext">whatever we may take</div></div>
  121. </div>
  122.   <div class="status_message">
  123.     eevyl went away
  124.     <span class="status_time"> (16:19)</span>
  125.   </div>    
  126.   <div class="status_message">
  127.     Away Message: Busy / Ocupado
  128.     <span class="status_time"> (16:19)</span>
  129.   </div>    
  130.   <div class="status_message">
  131.     eevyl came back
  132.     <span class="status_time"> (16:19)</span>
  133.   </div>
  134. <div class="incoming">
  135.     <div class="messagebody">
  136.         <span class="prefix"><span class="timestampbefore">(20:41:49) </span><span class="sender">eevyl</span><span class="senderScreenName">eevyl@mac.com</span><span class="timestampafter"> (20:41:49)</span>: </span>
  137.         huhuhuhu atest eth us heteshlthe tletshiet iso ehtioioseh tiseoteuo thseo oseht eh tset hshet stli ethsil etile thilsethilwsethilsthlsitehs ei
  138.     </div>
  139.     <div class="nextmessagebody">
  140.         <div class="nextmessagetext">huhuhu</div></div>
  141.     <div class="nextmessagebody">
  142.         <div class="nextmessagetext">ujdfbhfffdfsabhudfsabhjdfahbfjlfdabhjlsfdbjfdbhjfdbjfadbjafdlsafjbdlafdjlbafdsbjafdsbjfadsbjfdasjbfdasbjafdsbj</div></div>
  143. </div> 
  144. </div>
  145. <div class="bottomdivider"></div>
  146. </body>
  147. </html>
  148.